<template>
  <div>
    <!-- 标题 -->
    <van-nav-bar
      title="标题"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
      <van-card
    v-for="(item, index) in collList"
    :key="index"
    :price="item.price"
    :desc="item.desc"
    :title="item.title"
    :thumb="`http://liufusong.top:8080` + item.houseImg"
  >
    <template #tags>
      <van-tag
        plain
        type="danger"
        v-for="(item, index) in item.tags"
        :key="index"
      >
        {{ item }}
      </van-tag>
    </template>
  </van-card>
  </div>
  <!-- 渲染的房子数据列表 -->

</template>

<script>
import { CollectList } from '@/api'
export default {
  data () {
    return {
      token: localStorage.getItem('token'),
      collList: []
    }
  },
  async created () {
    console.log(this.token)
    const res = await CollectList(this.token)
    this.collList = res.data.body
    console.log(this.collList)
  },
  methods: {
    onClickLeft () {
      this.$router.replace('/Mine')
    }
  }
}
</script>
<style lang="less" scoped>
</style>
